﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="StudentGridUpload.aspx.cs" Inherits="Base_School_StudentGridUpload" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../Common/css/main.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../Common/js/jquery.js"></script>
    <script type="text/javascript" src="../../Common/js/TableForExport.js"></script>
    <script type="text/javascript" src="../Common/js/common.js"></script>
    <script type="text/javascript" src="../Common/js/msg.js"></script>  
    <script type="text/javascript"  language=javascript>
        function onOkclick()
        {
        
            if(document.getElementById("FileUpload1").value=="")
            {
                showMassgeBox("提示","请选择文件！",2,null);
            }
            else
            {
                document.getElementById("collomType").value=document.getElementById("selectInfo").selectedIndex;
                document.getElementById("Button1").click();
//                showConfirmBox("提示", "确定要这样操作吗?",nowDo,null);
                
            }
        }
        function nowDo(obj)
        {
            
        }
        function standardChange(index)
        {
            if(index==0)
            {
                
                document.getElementById("msg").innerText="依据学号将学生信息与学生所在班级信息进行更新。学号重复系统将自动忽略。本功能识别学生的标准是学号，请认真核对学号与学生姓名后再使用本功能。";
            }
            else
            {

                document.getElementById("msg").innerText="依据姓名只会将本班学生信息进行更新，不会调整学生班级。学号重复系统将自动忽略，出现同名情况请手动处理。请认真核对学生姓名与学号对应关系后再使用本功能。";
            }
        }
        function getExcel() {
            var cells = GetTableInfo(document.getElementById("dataTable"));
            if(cells!=null)
            {
                PageMethods.GetExcel(parent.parent.currClass,cells,function(result){
                    document.getElementById('downloadf').src = "";
                    document.getElementById('downloadf').src = "../../PostFileBytes.aspx";
                },function(err){alert(err._message);alert(err._message);});
            }
        }
        
        
        
    </script>  
</head>
<body scroll=no>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <div id="upInputPop" class="layoutWarp" style="width:350px;height:300px;overflow:hidden;border-width:0px;">
            <table border="0" class="layoutTable" >
                <tr>
                    <td width="320" align="left" style="padding-top:5px;padding-left:5px;">1. 您导入的学生名单将是本班的最终人员名单。</td>
                </tr>
                <tr>
                    <td width="320" align="left" style="padding-top:5px;padding-left:5px;">2. <a onclick="getExcel()"><u>获得本班导入模版</u></a></td>
                </tr>
                <tr>
                    <td width="320" align="left" style="padding-top:5px;padding-left:5px;">3. 选择覆盖基准信息<select id="selectInfo" onchange="standardChange(this.selectedIndex)" ><option>学号</option><option>姓名</option></select></td>
                </tr>
                <tr>
                    <td width="320" align="left" style="padding-top:5px;padding-left:5px;">4. <span style="color:Red;" id="msg">依据学号将学生信息与学生所在班级信息进行更新。学号重复系统将自动忽略。本功能识别学生的标准是学号，请认真核对学号与学生姓名后再使用本功能。</span> </td>
                </tr>
                <tr>
                    <td width="320" align="left" style="padding-top:5px;padding-left:5px;">5. 选择导入文件:<asp:FileUpload ID="FileUpload1" runat="server" /></td>
                </tr>
                <tr>
                    <td colspan ="2">
                    <div align="center">
                    <input name="btnOK" type="button" class="commonBut" style="padding-top:2px;" id="btnOK" onclick="onOkclick();" value="确定"   />
                    <input name="btnCancel" type="button" class="commonBut"style="padding-top:2px;" id="btnCancel"  onclick="return parent.ClosePopForm('upInputPop')" value="取消" />
                    <input name="btnOK" type="button" class="commonBut" style="padding-top:2px;display:none;" id="Button1" onclick="onOkclick();" value="确定" onserverclick="btnReqClsOK_ServerClick" runat="server" />
                    </div></td>
                </tr>
            </table>
        </div>
        <div  class="layoutWarp" style="display: none">
            <iframe src="" name="downloadf" id="downloadf" style="height: 80%;width: 95%;overflow-y:auto;overflow-x:none;" frameborder="0"   ></iframe>
        </div>
        <div style="display: none">
            <asp:HiddenField ID="collomType" runat="server" Value="0" />
            <table id="dataTable">
                <tr>
                    <td  style="text-align:left">学生学号</td>
                    <td  style="text-align:left">学生姓名</td>
                    <td  style="text-align:left">性别</td>
                    <td  style="text-align:left">出生日期</td>
                    <td  style="text-align:left">入团日期</td>
                </tr>
                <%=StudentsInfos%>
            </table>
        </div>
    </form>
</body>
</html>
